<?php
class SM_Controller extends BACKEND_Controller{
    //put your code here
    function __construct($table='',$prefix='',$id='id') {
        parent::__construct($table,$prefix,$id);
    }
    protected function privilege(){
		$this->privilege->aupr_permission = 0;
		if (
                !!array_intersect(array('Administrator','Admin','SM'),$this->authoritys)
        ){
			$this->privilege->aupr_permission = 777;
			return true;
		}
		return false;
	}
    function privilege_view(){
        $this->privilege->aupr_permission = 0;
        if (
                //strpos(",$this->authority,",',View,')!==false 
				!!array_intersect(array('View'),$this->authoritys)
        ){
			$this->privilege->aupr_permission = 755;
			return true;
		}
		if (
                //strpos(",$this->authority,",',View,')!==false 
				!!array_intersect(array('Administrator','Admin','SM'),$this->authoritys)
        ){
			$this->privilege->aupr_permission = 777;
			return true;
		}
		return false;
    }
}
?>
